#ifndef IMESH_H
#define IMESH_H
#pragma pack(push,1)

class	CAnimResult;
class	CMatrix;
class	CTransMat;



class IMesh : public SMeshData
{
public:
	static void	*AssetInit( IAssetFile *pFile, const CMasterIndexEntry *pEntry, void *context );
	static void	AssetUninit( void *ptr, void *context );
	static void	AssetFixup( CAssetFileMgr *pMgr, const IAssetFile *pFile, void *ptr, const CMasterIndexEntry *pEntry );

	static void	Register( CAssetFileMgr *pMgr )
	{
		pMgr->AddAssetType("MESH",AssetInit,AssetUninit,AssetFixup);
	}

public:

	bool	FindRefPoint( const char *name, u32 &pIndex ) const;
	void	ApplyAnimation( const CAnimResult *result, CTransMat *outMats ) const;
	CMatrix	&GetBoneMatrix( const CAnimResult &animResult, u32 idx, CMatrix &result ) const;
	CMatrix	&GetRefMatrix ( const CAnimResult &animResult, u32 idx, CMatrix &result ) const;
};


#pragma pack(pop)
#endif
